/*
 * @Author: feng.gan 675198494@qq.com
 * @Date: 2025-04-29 09:56:24
 * @LastEditors: feng.gan 675198494@qq.com
 * @LastEditTime: 2025-06-23 11:37:30
 * @FilePath: \vue3-demo\src\views\worldMapView\getData.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { chinaGeoCoordMap } from './chinaGeoCoordMap';
const countriesData = Object.keys(chinaGeoCoordMap)

const getRandomValueArray = (num = 10) => {
  const randomSet = new Set()
  while (randomSet.size < num) {
    randomSet.add(Math.floor(Math.random() * 20) | 0)
  }
  return Array.from(randomSet)
}

const getData = () => {
  const data = []
  getRandomValueArray(10).forEach(value => {
    const obj = {
      name: countriesData[Math.random()*2 | 0],
      value: Math.random() * 1000 | 0
    }
    data.push(obj)
  })
  return data
}
export default getData